package com.netas.kekmanager.dao.model;

import com.netas.kekmanager.dao.*;
import com.netas.kekmanager.dao.factory.*;
import com.netas.kekmanager.dao.exceptions.*;
import java.io.Serializable;
import java.util.*;

public class UserType implements Serializable
{
	/** 
	 * This attribute maps to the column id in the user_type table.
	 */
	protected int id;

	/** 
	 * This attribute maps to the column name in the user_type table.
	 */
	protected String name;

	/**
	 * Method 'UserType'
	 * 
	 */
	public UserType()
	{
	}

	/**
	 * Method 'getId'
	 * 
	 * @return int
	 */
	public int getId()
	{
		return id;
	}

	/**
	 * Method 'setId'
	 * 
	 * @param id
	 */
	public void setId(int id)
	{
		this.id = id;
	}

	/**
	 * Method 'getName'
	 * 
	 * @return String
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * Method 'setName'
	 * 
	 * @param name
	 */
	public void setName(String name)
	{
		this.name = name;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof UserType)) {
			return false;
		}
		
		final UserType _cast = (UserType) _other;
		if (id != _cast.id) {
			return false;
		}
		
		if (name == null ? _cast.name != name : !name.equals( _cast.name )) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + id;
		if (name != null) {
			_hashCode = 29 * _hashCode + name.hashCode();
		}
		
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return UserTypePk
	 */
	public UserTypePk createPk()
	{
		return new UserTypePk(id);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "com.netas.kekmanager.dao.dto.UserType: " );
		ret.append( "id=" + id );
		ret.append( ", name=" + name );
		return ret.toString();
	}

}
